package gat.dto.res.tg.excel;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

import java.util.Objects;

public class OrderStatusConverter implements Converter<Integer> {
    @Override
    public WriteCellData convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        if (Objects.equals(value,0)){
            return new WriteCellData<>("未支付");
        }else if (Objects.equals(value,1)){
            return new WriteCellData<>("已支付");
        }
        else if (Objects.equals(value,2)){
            return new WriteCellData<>("已取消");
        }
        else {
            return new WriteCellData<>("状态异常");
        }
    }

}
